package com.demo2do.fms.admin.service.supplier;

import java.util.List;
import java.util.Map;

import org.springframework.web.multipart.MultipartFile;

import com.demo2do.core.entity.page.Page;
import com.demo2do.fms.admin.entity.report.supplier.TrailerReportSearch;
import com.demo2do.fms.admin.entity.search.supplier.TrailerSearch;
import com.demo2do.fms.admin.entity.security.Login;
import com.demo2do.fms.admin.entity.upload.UploadResult;
import com.demo2do.fms.admin.service.DataService;
import com.demo2do.fms.entity.supplier.common.Supplier;
import com.demo2do.fms.entity.vehicle.AuditStatus;
import com.demo2do.fms.entity.vehicle.DeclareStatus;
import com.demo2do.fms.entity.vehicle.trailer.Trailer;
import com.demo2do.fms.entity.vehicle.trailer.TrailerModifiedVersion;

/**
 *
 * @author Ark
 *
 */
public interface TrailerService extends DataService<Trailer> {

    /**
     * @param status
     * @return
     */
    public int count(Login login, AuditStatus status);
    
    /**
     * @param status
     * @param page
     * @return
     */
    public List<Trailer> list(Login login, AuditStatus status, Page page);
    
    /**
     * @param search
     * @return
     */
    public int count(TrailerSearch search);
    
    /**
     * @param search
     * @param page
     * @return
     */
    public List<Trailer> search(TrailerSearch search, Page page);
    
    /**
     * @param trailer
     * @param login
     */
    public void create(Trailer trailer, Login login);
    
    /**
     * @param file
     * @param login
     * @return
     */
    public List<UploadResult> upload(MultipartFile file, Login login);
    
    /**
     * @param brandCNCode
     * @return
     */
    public boolean exist(String brandCNCode);
    
    /**
     * @param trailer
     * @param operator
     */
    public void edit(Trailer trailer, Long operator);
    
    /**
     * @param trailer
     * @param operator
     */
    public void audit(Trailer trailer, Long operator);
    
    /**
     * @param ids
     * @param operator
     * @return
     */
    public int batchAudit(List<Long> ids, Long operator);
    
    /**
     * @param trailer
     * @param operator
     */
    public void delete(Trailer trailer, Long operator);
    
    /**
     * @param trailer
     * @return
     */
    public TrailerModifiedVersion prepareChange(Trailer trailer);
    
    /**
     * @param trailer
     * @param version
     * @param operator
     */
    public void change(Trailer trailer, TrailerModifiedVersion version, Long operator);
    
    /**
     * @param trailer
     * @return
     */
    public TrailerModifiedVersion loadModifiedVersion(Trailer trailer);
    
    /**
     * @param trailer
     * @param supplier
     * @param operator
     */
    public void transfer(Trailer trailer, Supplier supplier, Long operator);
    
    /**
     * @param trailer
     * @param operator
     */
    public void out(Trailer trailer, Long operator);
    
    /**
     * @param login
     * @return
     */
    public int count(Login login);
    
    /**
     * @param login
     * @param page
     * @return
     */
    public List<Trailer> list(Login login, Page page);
    
    /**
     * @param search
     * @return
     */
    public List<Map<String, Object>> export(TrailerReportSearch search);
    
    /**
     * @param login
     * @return
     */
    public int countSub(Login login);
    
    /**
     * @param login
     * @param page
     * @return
     */
    public List<Trailer> listSub(Login login, Page page);
    
    /**
     * @param search
     * @param login
     * @return
     */
    public int countSub(TrailerSearch search, Login login);
    
    /**
     * @param search
     * @param login
     * @param page
     * @return
     */
    public List<Trailer> searchSub(TrailerSearch search, Login login, Page page);
    
    /**
     * @param login
     * @return
     */
    public int countAudit(Login login, DeclareStatus declareStatus);
    
    /**
     * @param login
     * @param page
     * @return
     */
    public List<Trailer> listAudit(Login login, DeclareStatus declareStatus, Page page);
    
    /**
     * @param trailer
     * @param operator
     */
    public void adoptAuditing(Trailer trailer, Long operator);
    
    /**
     * @param trailer
     * @param operator
     */
    public void adoptModified(Trailer trailer, Long operator);
    
    /**
     * @param trailer
     * @param operator
     */
    public void rejectAudit(Trailer trailer, Long operator);
    
    /**
     * @param vehicleSource
     * @param operator
     */
    public void rejectModified(Trailer trailer, Long operator);
    
    /**
     * @param supplier
     * @param status
     * @return
     */
    public List<Trailer> list(Supplier supplier, AuditStatus status);
    
    /**
     * @param supplier
     * @param status
     * @return
     */
    public List<Trailer> listUnbind(Supplier supplier, AuditStatus status);
    
}
